ggggllllXXXXIIIInnnnttttrrrroooo - Introduction to OpenGL in the X window system
OOOOVVVVEEEERRRRVVVVIIIIEEEEWWWW
OpenGL is a high-performance 3-D-oriented renderer. It is available in
the X window system through the GLX extension. Use ggggllllXXXXQQQQuuuueeeerrrryyyyEEEExxxxtttteeeennnnssssiiiioooonnnn and
ggggllllXXXXQQQQuuuueeeerrrryyyyVVVVeeeerrrrssssiiiioooonnnn to establish whether the GLX extension is supported by an
X server, and if so, what version is supported.
GLX extended servers make a subset of their visuals available for OpenGL
rendering. Drawables created with these visuals can also be rendered
using the core X renderer and with the renderer of any other X extension
that is compatible with all core X visuals.
GLX extends drawables with several buffers other than the standard color
buffer. These buffers include back and auxiliary color buffers, a depth
buffer, a stencil buffer, and a color accumulation buffer. Some or all
are included in each X visual that supports OpenGL.
To render using OpenGL into an X drawable, you must first choose a visual
that defines the required OpenGL buffers. ggggllllXXXXCCCChhhhoooooooosssseeeeVVVViiiissssuuuuaaaallll can be used to
simplify selecting a compatible visual. If more control of the selection
process is required, use XXXXGGGGeeeettttVVVViiiissssuuuuaaaallllIIIInnnnffffoooo and ggggllllXXXXGGGGeeeettttCCCCoooonnnnffffiiiigggg to select among
all the available visuals.
Use the selected visual to create both a GLX context and an X drawable.
GLX contexts are created with ggggllllXXXXCCCCrrrreeeeaaaatttteeeeCCCCoooonnnntttteeeexxxxtttt, and drawables are created
with either XXXXCCCCrrrreeeeaaaatttteeeeWWWWiiiinnnnddddoooowwww or ggggllllXXXXCCCCrrrreeeeaaaatttteeeeGGGGLLLLXXXXPPPPiiiixxxxmmmmaaaapppp. Finally, bind the
context and the drawable together using ggggllllXXXXMMMMaaaakkkkeeeeCCCCuuuurrrrrrrreeeennnntttt. This
context/drawable pair becomes the current context and current drawable,
and it is used by all OpenGL commands until ggggllllXXXXMMMMaaaakkkkeeeeCCCCuuuurrrrrrrreeeennnntttt is called with
different arguments.
Both core X and OpenGL commands can be used to operate on the current
drawable. The X and OpenGL command streams are not synchronized,
however, except at explicitly created boundaries generated by calling
ggggllllXXXXWWWWaaaaiiiittttGGGGLLLL, ggggllllXXXXWWWWaaaaiiiittttXXXX, XXXXSSSSyyyynnnncccc, and ggggllllFFFFlllluuuusssshhhh.
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
Below is the minimum code required to create an RGBA-format, OpenGL-
compatible X window and clear it to yellow. The code is correct, but it
does not include any error checking. Return values _d_p_y, _v_i, _c_x, _c_m_a_p,
The SSSSGGGGIIIISSSS____mmmmuuuullllttttiiiissssaaaammmmpppplllleeee extension provides a mechanism to antialias all
primitives. (This extension is described in more detail in ggggllllIIIInnnnttttrrrroooo.) In
order to support multisampling both GLX and OpenGL had to be extended.
The GLX portion of the extension, designated as SSSSGGGGIIIISSSS____mmmmuuuullllttttiiiissssaaaammmmpppplllleeee,
includes new visual attributes which can be specified when calling
ggggllllXXXXCCCChhhhoooooooosssseeeeVVVViiiissssuuuuaaaallll and ggggllllXXXXGGGGeeeettttCCCCoooonnnnffffiiiigggg.
The SSSSGGGGIIII____mmmmaaaakkkkeeee____ccccuuuurrrrrrrreeeennnntttt____rrrreeeeaaaadddd extension allows OpenGL pixel operations to
read pixel data from the buffers of one drawable and draw into the
buffers of another. For example, pixels can be copied from one window
into another, or from a GLXPbuffer into a window. For more information
see ggggllllXXXXMMMMaaaakkkkeeeeCCCCuuuurrrrrrrreeeennnnttttRRRReeeeaaaaddddSSSSGGGGIIII and ggggllllXXXXGGGGeeeettttCCCCuuuurrrrrrrreeeennnnttttRRRReeeeaaaaddddDDDDrrrraaaawwwwaaaabbbblllleeeeSSSSGGGGIIII.
The SSSSGGGGIIIIXXXX____vvvviiiiddddeeeeoooo____ssssoooouuuurrrrcccceeee extension allows pixel data to be sourced from a
video input stream. It defines a new type of drawable,
GLXVideoSourceSGIX, that represents the drain node of a Video Library
(VL) path. A GLXVideoSourceSGIX may be passed as a parameter to
ggggllllXXXXMMMMaaaakkkkeeeeCCCCuuuurrrrrrrreeeennnnttttRRRReeeeaaaaddddSSSSGGGGIIII to indicate that pixel data should be read from the
specified video source instead of from the framebuffer. For more infor-
mation, see ggggllllXXXXCCCCrrrreeeeaaaatttteeeeGGGGLLLLXXXXVVVViiiiddddeeeeooooSSSSoooouuuurrrrcccceeeeSSSSGGGGIIIIXXXX and ggggllllXXXXDDDDeeeessssttttrrrrooooyyyyGGGGLLLLXXXXVVVViiiiddddeeeeooooSSSSoooouuuurrrrcccceeeeSSSSGGGGIIIIXXXX.
Procedure names and tokens for GLX extensions are either suffixed with
EXT, SGI, SGIS or SGIX. The meaning of these suffixes is described in
ggggllllIIIInnnnttttrrrroooo.
All supported GLX extensions will have a corresponding definition in
glx.h and a token in the extension string returned by ggggllllXXXXQQQQuuuueeeerrrryyyyEEEExxxxtttteeeennnnssssiiiioooonnnnssss----
SSSSttttrrrriiiinnnngggg. For example, if the SSSSGGGGIIII____vvvviiiiddddeeeeoooo____ssssyyyynnnncccc extension is supported then
this token will be defined in glx.h and SSSSGGGGIIII____vvvviiiiddddeeeeoooo____ssssyyyynnnncccc will appear in the
extension string returned by ggggllllXXXXQQQQuuuueeeerrrryyyyEEEExxxxtttteeeennnnssssiiiioooonnnnssssSSSSttttrrrriiiinnnngggg. The definitions in
glx.h can be used at compile time to determine if procedure calls
corresponding to an extension exist in the library. However, extensions
which are defined in glx.h might not be implemented on all SGI platforms.
OpenGL also has been extended. Refer to ggggllllIIIInnnnttttrrrroooo for more information.
GGGGLLLLXXXX 1111....1111
SGI now supports GLX 1.1: this is backwards compatible with GLX 1.0 and
corresponds to OpenGL version 1.0. Call ggggllllXXXXQQQQuuuueeeerrrryyyyVVVVeeeerrrrssssiiiioooonnnn to determine at
runtime what version of GLX is being used. (If you are doing remote
rendering, GLX version 1.1 will only be used if both the client and
server can support it. This allows GLX 1.1 clients and servers to commun-
icate with GLX 1.0 clients and servers.) You can also check the GLX ver-
sion at compile time: GLX_VERSION_1_1 will be defined in glx.h if GLX 1.1
calls are supported.
The following new calls were introduced in GLX 1.1: ggggllllXXXXQQQQuuuueeeerrrryyyyEEEExxxxtttteeeennnnssssiiiioooonnnnssss----
SSSSttttrrrriiiinnnngggg, ggggllllXXXXQQQQuuuueeeerrrryyyySSSSeeeerrrrvvvveeeerrrrSSSSttttrrrriiiinnnngggg, and ggggllllXXXXGGGGeeeettttCCCClllliiiieeeennnnttttSSSSttttrrrriiiinnnngggg.